package com.kirk.cts.core.runcycle.support;

import com.kirk.cts.core.runcycle.schedule.ScheduleEnum;
import com.kirk.cts.core.runcycle.schedule.processor.IShutDownScheduleProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.List;
import java.util.TreeSet;


/**
 * <p> ShutDownSchedule.java </p>
 *
 * @version 1.0.0
 * @Author kirkliu
 * @Date 2020-08-30 17:02
 * @Description 停止计划
 */
@Component("shutDownSchedule")
public class ShutDownSchedule extends AbstractSchedule<IShutDownScheduleProcessor> {
    @Autowired
    private List<IShutDownScheduleProcessor> shutDownScheduleProcessor;

    @Override
    public ScheduleEnum getSchedule() {
        return ScheduleEnum.SHUTDOWN;
    }


    @Override
    protected Collection<IShutDownScheduleProcessor> getScheduleProcessors() {
        if (null != this.shutDownScheduleProcessor) {
            return new TreeSet<IShutDownScheduleProcessor>(this.shutDownScheduleProcessor);
        }
        return null;
    }

    public void setShutDownScheduleProcessor(
            List<IShutDownScheduleProcessor> shutDownScheduleProcessor) {
        this.shutDownScheduleProcessor = shutDownScheduleProcessor;
    }


}
